/*
 * Path.hpp
 * This file is part of Dragon and Weed 2
 *
 * Copyright (C) 2011 - François Berder, Syméon Manlengreau

 *
 * Dragon and Weed 2 is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * Dragon and Weed 2 is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef PATH_HPP_INCLUDED
#define PATH_HPP_INCLUDED

#include <boost/filesystem.hpp>
#include <string>


 /** \class Path
     \brief This a convenience class used to check the validity of a path given.
*/
class Path
{
	public :

    /** \brief Default constructor
        \param path The path to check
    */
	Path(const std::string& path);

    /** \brief Check the validity of the path given in the constructor.
        \return A boolean
        \note If checks if the path is a file and if this file exists.
        \note If the path given is a directory, it returns false.
    */
	bool isValid();

	/** \return Returns only the the name of the file

        Ex : fileName = "../../data/myFile"
        This function will return "myFile"
    */
	std::string fileName() const;

	private :
		/* data */
		boost::filesystem::path m_path;
};


#endif

